<?php
class Supply extends BaseBean{
	
	public $_table= "tb_supply";
	public $_primarykey= "id";
	public $_mustFields =array("name"=>"供应商名称");

    public function insertItem(){
        $num =$this->connection->fetchColumn("select max(num) as num from tb_supply")+1;
        $this->set("num",$num);
        $num = MAX_SUPPLY_NUM + $num;
        $this->set("code", substr($num."",1));
        parent::insertItem();
    }

}
?>